﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageLayout.master" AutoEventWireup="true" CodeBehind="frmLophoc.aspx.cs" Inherits="BVVD_Website.ql_danh_muc.frmLophoc2" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="5">        
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel runat="server" ID="pnlAjax" LoadingPanelID="RadAjaxLoadingPanel1">
    <div id="Div1" class="mpBottomContent" runat="server">
        <asp:Label runat="server" ID="lblMenu" Style="margin: 0 auto 0 auto; font-family: 'Microsoft Sans Serif'; font-size: larger; color: forestgreen" Text="DANH SÁCH LỚP HỌC"></asp:Label>
        <table style="margin: 0 auto 0 auto; border: 5px thin red; width: 90% !important; height: auto !important; padding: 5px 5px 5px 5px">
            <caption style="float: left">
            </caption>
            <tr>
                <td>
                    <telerik:RadGrid ID="grvLophoc" Skin="Hay" AllowFilteringByColumn="true" MasterTableView-NoMasterRecordsText="Không tìm thấy bản ghi nào" MasterTableView-ShowHeadersWhenNoRecords="true" ClientSettings-ColumnsReorderMethod="Reorder" ClientSettings-AllowColumnsReorder="true" ClientSettings-Animation-AllowColumnReorderAnimation="true" ClientSettings-Animation-ColumnReorderAnimationDuration="300" PageSize="15" AllowSorting="true"  AutoGenerateColumns="false" AllowPaging="true" ClientSettings-AllowDragToGroup="true" runat="server" OnDeleteCommand="grvLophoc_DeleteCommand" OnInsertCommand="grvLophoc_InsertCommand" OnNeedDataSource="grvLophoc_NeedDataSource" OnItemDataBound="grvLophoc_ItemDataBound" OnUpdateCommand="grvLophoc_UpdateCommand">

                        <PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="RadComboBox"   Wrap="true" AlwaysVisible="true" />

                        <MasterTableView CommandItemDisplay="Top" EnableNoRecordsTemplate="true" CssClass="MasterClass" ShowFooter="true" EditMode="PopUp" Summary="SUMMARY" ShowHeadersWhenNoRecords="true"
                            DataKeyNames="RECID">
                            <CommandItemSettings AddNewRecordText="Thêm mới" RefreshText="Làm mới danh sách" ExportToPdfText="Xuất file dạng PDF" ShowExportToPdfButton="true"></CommandItemSettings>
                            <CommandItemSettings ExportToExcelText="XUất file dạng Excel" ShowExportToExcelButton="true"></CommandItemSettings>

                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
                            <NoRecordsTemplate>
                                <div>
                                    Không có bản ghi nào
                                </div>
                            </NoRecordsTemplate>
                            <Columns>

                                <telerik:GridBoundColumn UniqueName="RECID" EditFormColumnIndex="1" Display="false" ReadOnly="true" HeaderText="" DataField="RECID">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                    <HeaderStyle ForeColor="Silver" Width="20px"></HeaderStyle>
                                    <ItemStyle ForeColor="Gray"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MALH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã lớp" DataField="MALH">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>

                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="TENLH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="30%" HeaderText="Tên lớp" DataField="TENLH">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="KIEULOPHOC" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Hệ lớp" DataField="KIEULOPHOC">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                
                                <telerik:GridBoundColumn UniqueName="THOIGIANHOC" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" DataType="System.Int32" FilterControlWidth="70%" HeaderStyle-Width="40%" HeaderText="Thời gian học" DataField="THOIGIANHOC">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>




                                <telerik:GridBoundColumn UniqueName="HOCPHI" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" FilterControlWidth="70%" Display="true" HeaderStyle-Width="30%" HeaderText="Học phí" DataField="HOCPHI">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridTemplateColumn UniqueName="TRANGTHAI" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" Display="true" HeaderStyle-Width="15%" HeaderText="Trạng thái" DataField="TRANGTHAI">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblTRANGTHAI" Text='<%# DataBinder.Eval(Container.DataItem,"TRANGTHAI").ToString().Equals("1")?"ACTIVE":"CLOSED" %>'></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>



                                <telerik:GridEditCommandColumn EditText="Sửa" ButtonType="ImageButton" ItemStyle-Width="60" HeaderText="Sửa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60">
                                </telerik:GridEditCommandColumn>
                                <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" HeaderText="Xóa" ItemStyle-Width="60" HeaderStyle-Width="60" ConfirmDialogType="RadWindow" ConfirmTextFormatString="Bạn chắc chắn muốn xóa bản ghi  \n <br> Mã lớp học : {0} <br> \tTên lớp học :  {1} \n " ConfirmTextFields="MALH, TENLH" ConfirmTitle="Xác nhận xóa" ConfirmText="Xóa, Hủy" Text="Xóa" UniqueName="btnDelete">
                                </telerik:GridButtonColumn>
                            </Columns>
                            <EditFormSettings EditFormType="Template" PopUpSettings-ShowCaptionInEditForm="true" PopUpSettings-ScrollBars="Auto" InsertCaption="Thêm mới lớp học" PopUpSettings-ZIndex="4000" PopUpSettings-Modal="true" CaptionFormatString="Mã lớp học {0}" CaptionDataField="MALH">
                                <FormTemplate>
                                    <div id="rfd-demo-zone" style="width: auto; overflow: auto;text-align:left; border: solid; border-color: whitesmoke; border-width: 5px; padding: 6px 6px 6px 6px;">
                                        <table width="350" border="0" cellspacing="10" cellpadding="10">
                                            <caption style="color: green; font-weight: bold">
                                                CHI TIẾT LỚP HỌC
                                            </caption>
                                            <tr>
                                                <td></td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <td>Mã lớp học</td>
                                                <td>
                                                    <telerik:RadTextBox runat="server" Style="color: green; font-weight: bold" Skin="Telerik" Text='<%# Bind("MALH")  %>' ID="txtMALH"></telerik:RadTextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" Display="Dynamic" runat="server" ControlToValidate="txtMALH" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Tên lớp</td>
                                                <td>
                                                    <telerik:RadTextBox runat="server" Skin="Telerik" Text='<%# Bind("TENLH")  %>' ID="txtTENLH"></telerik:RadTextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" runat="server" ControlToValidate="txtTENLH" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Hệ lớp</td>
                                                <td>
                                                    <telerik:RadDropDownList  Skin="Telerik" runat="server" ID="ddlKIEULOPHOC">
                                                        <Items>
                                                            <telerik:DropDownListItem Value="1" Text="Liên tục" Selected="true" />
                                                            <telerik:DropDownListItem Value="2" Text="Bổ túc" />
                                                            <telerik:DropDownListItem Value="3" Text="Chính quy" />
                                                        </Items>
                                                    </telerik:RadDropDownList>
                                                    
                                                </td>
                                            </tr>

                                            <tr>
                                                <td>Thời gian học</td>
                                                <td>
                                                    <telerik:RadDropDownList runat="server" Skin="Telerik" ID="ddlTONG_TGH" DataValueField="MADM" DefaultMessage="Chọn" DropDownHeight="200" DataTextField="TENDM"></telerik:RadDropDownList>
                                                    <%--asp:RequiredFieldValidator ID="RequiredFieldValidator2" Display="Dynamic" runat="server" ControlToValidate="txtTHOIGIANHOC" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </--%asp:RequiredFieldValidator--%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Học phí</td>
                                                <td>
                                                    <telerik:RadNumericTextBox runat="server" Skin="Telerik" ShowSpinButtons="true" Type="Currency" NumberFormat-DecimalDigits="0" Culture="vi-VN" NumberFormat-GroupSeparator=" " DbValue='<%# Bind("HOCPHI")  %>' ID="txtHOCPHI"></telerik:RadNumericTextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" Display="Dynamic" runat="server" ControlToValidate="txtHOCPHI" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Trạng thái</td>
                                                <td>
                                                    <asp:RadioButtonList runat="server" ID="rblTRANGTHAI" CellPadding="20" RepeatDirection="Horizontal">
                                                        <asp:ListItem Text="Mở" Value="1" Selected="True"></asp:ListItem>
                                                        <asp:ListItem Text="Đóng" Value="0"></asp:ListItem>
                                                    </asp:RadioButtonList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Ghi chú</td>
                                                <td>
                                                    <telerik:RadTextBox runat="server" ID="txtGHICHU"  Skin="Telerik" TextMode="MultiLine" Text='<%# Bind("GHICHU")  %>'></telerik:RadTextBox></td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td>
                                                    <asp:LinkButton ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Thêm mới" : "Cập nhật" %>'
                                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:LinkButton>&nbsp;
                                <asp:LinkButton ID="btnCancel" Text="Hủy" runat="server" CausesValidation="False"
                                    CommandName="Cancel"></asp:LinkButton></td>
                                            </tr>
                                        </table>
                                    </div>
                                </FormTemplate>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <ClientEvents OnPopUpShowing="PopUpShowing" />
                            <ClientEvents OnRowDblClick="RowDblClick" />
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="500" />

                        </ClientSettings>
                        <ExportSettings Excel-Format="Biff" Pdf-DefaultFontFamily="Arial" FileName="Mydata" IgnorePaging="false" Excel-AutoFitImages="true" Excel-FileExtension="xls" HideStructureColumns="true"></ExportSettings>
                    </telerik:RadGrid>
                </td>
            </tr>
        </table>
    </div>

    <telerik:RadNotification ID="rnAlert" ContentScrolling="Auto" runat="server" Width="300" Position="TopRight" EnableRoundedCorners="true"
        EnableShadow="true" Skin="Hay" Overlay="true" Animation="Fade" AnimationDuration="1000" Title="Thông báo">
    </telerik:RadNotification>
        </telerik:RadAjaxPanel>
</asp:Content>
